<template>
  <div class="person">
    <h1>中国</h1>
    <h2 ref="title">北京</h2>
    <button @click="outTitle">点击输出title内容</button>
    <h3 >尚硅谷</h3>
  </div>
</template>

<script lang="ts" setup>
  import {ref} from "vue";

  let title = ref();

  function outTitle(){
    console.log(title.value);
  }

</script>

<style scoped>
  .person{
    background-color: skyblue;
    box-shadow: 0 0 10px;
    border-radius: 10px;
    padding: 20px;
  }
</style>
